package city.spring.modules.medicalstation.drugwarehouseShelfExt.repository;

import city.spring.modules.medicalstation.drugwarehouseShelfExt.entity.DrugwarehouseShelfExtEntity;
import city.spring.modules.medicalstation.drugwarehouseShelfExt.vo.DrugwarehouseShelflevelVO;
import city.spring.modules.medicine.entity.MedicinewarehousingMedicineExtEntity;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 存储库：医护站药品入库与货架关联表
 *
 * @author 谢金婷
 * @date 2020-09-24 16:34:05
 */
@Repository
public interface DrugwarehouseShelfExtRepository extends BaseMapper<DrugwarehouseShelfExtEntity> {
    /**
     * 获取入库的货架层次列表
     *
     * @param wrapper 查询对象
     * @return
     */
    List<DrugwarehouseShelflevelVO> getShelflevels(@Param(Constants.WRAPPER) Wrapper<? extends MedicinewarehousingMedicineExtEntity> wrapper);

    /**
     * 获取入库的货架层次列表
     *
     * @param warehousingId 入库单ID
     * @return
     */
    List<DrugwarehouseShelflevelVO> getWarehousingShelflevels(Integer warehousingId);

    /**
     * 获取出库的某个药品
     *
     * @param warehousingId 入库ID
     * @param extId         主键ID
     * @return
     */
    DrugwarehouseShelflevelVO getWarehousingShelflevel(Integer warehousingId, String extId);

    /**
     * 获取入库的货架列表
     *
     * @param warehousingId 入库单ID
     * @return
     */
    List<DrugwarehouseShelfExtEntity> getWarehousingSls(Integer warehousingId);

    /**
     * 根据warehousingId查找该warehousingId下的入库药品信息
     *
     * @param warehousingId
     * @return
     */
    List<DrugwarehouseShelfExtEntity> getByWarehousingId(Integer warehousingId);
}